Meteor.publish("drivers", function () {
  return Drivers.find({});
});

Meteor.publish("driver_apply", function () {
  return Applys.find({});
});

Meteor.publish("applys", function () {
  return Applys.find(
  	{
  		pass: false,
  	},{
  		limit: 20,
  	});
});

Meteor.publish("new_message", function () {
  return Messages.find({
		  	userid: this.userId,
		  	read: false 
		},{
			limit: 5,
		});
});

Applys.allow({
	insert: function (userId, doc) {
		return true;
	},
	update: function (userId, doc, fields, modifier) {
		return true;
	},
	remove: function (userId, doc) {
		return true;
	},
	/*
	fetch: ['owner'],
	transform: function () {
		//...
	}
	*/
});

Messages.allow({
	insert: function (userId, doc) {
		return true;
	},
	update: function (userId, doc, fields, modifier) {
		return true;
	},
	remove: function (userId, doc) {
		return true;
	}
});